package com.wj.rpsm.admin.mapper;

import com.github.pagehelper.Page;
import com.wj.rpsm.admin.pojo.Room;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author WeiJin
 * @version 1.0
 */
@Repository
public interface RoomMapper {

    /**
     * 动态sql
     * 根据房间号查询
     * @param number 原始1-1-1类型
     * @return
     */
    @Select("<script> select * from room <where> <if " +
            "test='number !=null and number !=\"\"'> room_code like " +
            "concat('%',#{number},'%')</if></where></script>")
    Page<Room> findAllRoom(@Param("number") String  number);
}
